/**
 *
 */
package gemini.basic.exception;

/**
 * Base class for all runtime exceptions shared between client and server.
 *
 */
public class GmnClientRuntimeException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	//This property is set by the FKR RPC interceptor which trap all runtime exceptions thrown by the RPC service
    //and put the stacktrace here in order to be able to display it on the browser.
    private String causeStacktrace;

    private boolean isObjectNotFoundException = false;
    private boolean isConcurrencyFailureException = false;

    public GmnClientRuntimeException() {
        //Default constructor required by GWT otherwise it won't compile
    }

    public GmnClientRuntimeException(final String message, final Throwable cause) {
        super(message, cause);
    }

    public GmnClientRuntimeException(final String message) {
        super(message);
    }

    public GmnClientRuntimeException(final Throwable cause) {
        super(cause);
    }

    public String getCauseStacktrace() {
        return causeStacktrace;
    }

    public void setCauseStacktrace(final String causeStacktrace) {
        this.causeStacktrace = causeStacktrace;
    }

    public boolean isObjectNotFoundException() {
        return isObjectNotFoundException;
    }

    public void setObjectNotFoundException(boolean objectNotFoundException) {
        this.isObjectNotFoundException = objectNotFoundException;
    }

    public boolean isConcurrencyFailureException() {
        return isConcurrencyFailureException;
    }

    public void setConcurrencyFailureException(boolean concurrencyFailureException) {
        this.isConcurrencyFailureException = concurrencyFailureException;
    }
}
